<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript" src="./js/jquery.min.js"></script>
	<script type="text/javascript" src="./js/handlebars-v3.0.0.js"></script>

</head>
<body>
	<script type="text/x-handlebars-template" id="tbody-tr">
		{{#each student}}
			<tr>
				<td>{{name}}</td>
				<td>{{sex}}</td>
				<td>{{age}}</td>
			</tr>
		{{/each}}
	</script>
	<table border="1">
		<thead>
			<tr>
				<th>姓名</th>
				<th>性别</th>
				<th>年龄</th>
			</tr>
		</thead>
		<tbody>
			
		</tbody>
	</table>
	<script type="text/javascript">
	 var houdun = {
	 	"student"	: [
	 		{
	 			"name" : '向强华',
	 			"sex"  : '男',
	 			"age"  : 20
	 		},
	 		{
	 			"name" : '李貌',
	 			"sex"  : '男',
	 			"age"  : 22
	 		},
	 		{
	 			"name" : '齐乐',
	 			"sex"  : '男',
	 			"age"  : 28
	 		}

	 	]


	 }

	 var myTpl = Handlebars.compile($('#tbody-tr').html());
	 $('tbody').html(myTpl(houdun));

	</script>

</body>
</html>